<template>
  <div class="ali-pay">
      <loading v-if="Loading"></loading>
    <div class="from" v-html="content"></div>
  </div>
</template>
<script>
import Loading from './../components/Loading.vue'
export default {
  name: "lipay",
   components:{
       Loading
   },
  data() {
    return {
      orderId: this.$route.query.orderId,
      content: "",
      Loading:true
    };
  },
  mounted() {
    this.paySubmit();
  },
  methods:{
    paySubmit() {
      this.axios.post("/pay", {
          orderId: this.orderId,
          orderName: "Vue高仿小米商城",
          amount: 0.01, //单位元
          payType: 1, //1支付宝，2微信
        }).then((res) => {
          //  console.log(res)
          this.content = res.content;//获取二维码的网页
          setTimeout(()=>{
              document.forms[0].submit();
          },100)
        });
    },
  },
};
</script>
